package com.ler.yrmall.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ler.yrmall.member.entity.GrowthChangeHistoryEntity;
import com.ler.yrmall.member.entity.IntegrationChangeHistoryEntity;
import com.ler.yrmall.member.mapper.IntegrationChangeHistoryMapper;
import com.ler.yrmall.member.service.IntegrationChangeHistoryService;
import com.ler.yrmall.utils.SecurityUtils;
import org.springframework.stereotype.Service;

/**
 * @author leron
 */
@Service
public class IntegrationChangeHistoryServiceImpl extends ServiceImpl<IntegrationChangeHistoryMapper, IntegrationChangeHistoryEntity> implements IntegrationChangeHistoryService {

    @Override
    public void checkin() {
        IntegrationChangeHistoryEntity integrationChangeHistory = new IntegrationChangeHistoryEntity();
        integrationChangeHistory.setChangeCount(GrowthChangeHistoryEntity.DataSource.CHECKIN.getScore());
        integrationChangeHistory.setDataSource(GrowthChangeHistoryEntity.DataSource.CHECKIN.getCode());
        integrationChangeHistory.setRemark(GrowthChangeHistoryEntity.DataSource.CHECKIN.getRemark());
        integrationChangeHistory.setMemberId(SecurityUtils.getLoginUser().getId());
        integrationChangeHistory.insert();
    }

}